<?php
/**
 * Created by PhpStorm.
 * User: Edik
 * Date: 2016/2/23
 * Time: 14:56
 */

namespace Admin\Controller;


use Admin\Model\NewsModel;
use Admin\Model\ServerModel;

class HomeController extends AdminBaseController
{
    function index(){
        $model = new NewsModel();

        $news = $model->where(' article_class = 2')->field('id')->select();
        $zp = $model->where(' article_class = 1')->field('id')->select();

        $model = new ServerModel();
        $xm = $model->select();

        $this->assign('news',count($news));
        $this->assign('zp',count($zp));
        $this->assign('xm',count($xm));
        $this->display();
    }


}